# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
package(
    default_visibility = ["//visibility:public"],
    licenses = ["notice"],
)

cc_library(
    name = "consumer_notifier_adapter",
    srcs = ["consumer_notifier_adapter.cc"],
    hdrs = ["consumer_notifier_adapter.h"],
    deps = [
        "@com_google_absl//absl/log",
        "@sonic_swss_common//:libswsscommon",
    ],
)

cc_library(
    name = "mock_consumer_notifier_adapter",
    testonly = True,
    hdrs = ["mock_consumer_notifier_adapter.h"],
    deps = [
        ":consumer_notifier_adapter",
        "@com_google_googletest//:gtest",
        "@sonic_swss_common//:libswsscommon",
    ],
)

cc_library(
    name = "fake_consumer_notifier_adapter",
    testonly = True,
    srcs = ["fake_consumer_notifier_adapter.cc"],
    hdrs = ["fake_consumer_notifier_adapter.h"],
    deps = [
        ":consumer_notifier_adapter",
        ":fake_sonic_db_table",
        "@com_google_absl//absl/log",
    ],
)

cc_library(
    name = "notification_producer_adapter",
    srcs = ["notification_producer_adapter.cc"],
    hdrs = ["notification_producer_adapter.h"],
    deps = ["@sonic_swss_common//:libswsscommon"],
)

cc_library(
    name = "mock_notification_producer_adapter",
    testonly = True,
    hdrs = ["mock_notification_producer_adapter.h"],
    deps = [
        ":notification_producer_adapter",
        "@com_google_googletest//:gtest",
        "@sonic_swss_common//:libswsscommon",
    ],
)

cc_library(
    name = "fake_notification_producer_adapter",
    testonly = True,
    srcs = ["fake_notification_producer_adapter.cc"],
    hdrs = ["fake_notification_producer_adapter.h"],
    deps = [
        ":fake_sonic_db_table",
        ":notification_producer_adapter",
        "@sonic_swss_common//:common",
    ],
)

cc_library(
    name = "producer_state_table_adapter",
    srcs = ["producer_state_table_adapter.cc"],
    hdrs = ["producer_state_table_adapter.h"],
    deps = [
        "@com_google_absl//absl/log",
        "@sonic_swss_common//:libswsscommon",
    ],
)

cc_library(
    name = "mock_producer_state_table_adapter",
    testonly = True,
    hdrs = ["mock_producer_state_table_adapter.h"],
    deps = [
        ":producer_state_table_adapter",
        "@com_google_googletest//:gtest",
        "@sonic_swss_common//:libswsscommon",
    ],
)

cc_library(
    name = "fake_producer_state_table_adapter",
    testonly = True,
    srcs = ["fake_producer_state_table_adapter.cc"],
    hdrs = ["fake_producer_state_table_adapter.h"],
    deps = [
        ":fake_sonic_db_table",
        ":producer_state_table_adapter",
        "@com_google_absl//absl/log",
        "@sonic_swss_common//:libswsscommon",
    ],
)

cc_library(
    name = "system_call_adapter",
    srcs = ["system_call_adapter.cc"],
    hdrs = ["system_call_adapter.h"],
)

cc_library(
    name = "mock_system_call_adapter",
    testonly = True,
    hdrs = ["mock_system_call_adapter.h"],
    deps = [
        ":system_call_adapter",
        "@com_google_googletest//:gtest_main",
    ],
)

cc_library(
    name = "table_adapter",
    srcs = ["table_adapter.cc"],
    hdrs = ["table_adapter.h"],
    deps = [
        "@com_google_absl//absl/strings",
        "@sonic_swss_common//:libswsscommon",
    ],
)

cc_library(
    name = "mock_table_adapter",
    testonly = True,
    hdrs = ["mock_table_adapter.h"],
    deps = [
        ":table_adapter",
        "@com_google_googletest//:gtest",
        "@sonic_swss_common//:libswsscommon",
    ],
)

cc_library(
    name = "fake_table_adapter",
    testonly = True,
    srcs = ["fake_table_adapter.cc"],
    hdrs = ["fake_table_adapter.h"],
    deps = [
        ":fake_sonic_db_table",
        ":table_adapter",
        "@com_google_absl//absl/log",
        "@com_google_absl//absl/strings",
        "@sonic_swss_common//:libswsscommon",
    ],
)

cc_library(
    name = "fake_warm_boot_state_adapter",
    testonly = True,
    srcs = ["fake_warm_boot_state_adapter.cc"],
    hdrs = ["fake_warm_boot_state_adapter.h"],
    deps = [
        ":warm_boot_state_adapter",
        "@sonic_swss_common//:libswsscommon",
    ],
)

cc_library(
    name = "fake_sonic_db_table",
    testonly = True,
    srcs = ["fake_sonic_db_table.cc"],
    hdrs = ["fake_sonic_db_table.h"],
    deps = [
        "@com_google_absl//absl/base:core_headers",
        "@com_google_absl//absl/container:flat_hash_map",
        "@com_google_absl//absl/log",
        "@com_google_absl//absl/status",
        "@com_google_absl//absl/status:statusor",
        "@com_google_absl//absl/strings",
        "@com_google_absl//absl/strings:str_format",
        "@com_google_absl//absl/synchronization",
    ],
)

cc_test(
    name = "fake_sonic_db_table_test",
    srcs = ["fake_sonic_db_table_test.cc"],
    deps = [
        ":fake_sonic_db_table",
        "//gutil/gutil:status_matchers",
        "@com_google_absl//absl/status",
        "@com_google_absl//absl/status:statusor",
        "@com_google_googletest//:gtest_main",
    ],
)

cc_test(
    name = "fake_warm_boot_state_adapter_test",
    srcs = ["fake_warm_boot_state_adapter_test.cc"],
    deps = [
        ":fake_warm_boot_state_adapter",
        "@com_google_googletest//:gtest_main",
        "@sonic_swss_common//:libswsscommon",
    ],
)

cc_library(
    name = "subscriber_state_table_adapter",
    srcs = ["subscriber_state_table_adapter.cc"],
    hdrs = ["subscriber_state_table_adapter.h"],
    deps = [
        "@com_google_absl//absl/log",
        "@sonic_swss_common//:libswsscommon",
    ],
)

cc_library(
    name = "mock_subscriber_state_table_adapter",
    testonly = True,
    hdrs = ["mock_subscriber_state_table_adapter.h"],
    deps = [
        ":subscriber_state_table_adapter",
        "@com_google_googletest//:gtest",
        "@sonic_swss_common//:common",
    ],
)

cc_library(
    name = "warm_boot_state_adapter",
    srcs = ["warm_boot_state_adapter.cc"],
    hdrs = ["warm_boot_state_adapter.h"],
    deps = ["@sonic_swss_common//:libswsscommon"],
)

cc_library(
    name = "mock_warm_boot_state_adapter",
    testonly = True,
    hdrs = ["mock_warm_boot_state_adapter.h"],
    deps = [
        ":warm_boot_state_adapter",
        "@com_google_googletest//:gtest",
        "@sonic_swss_common//:common",
    ],
)
